//
//  Test2.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/3.
//

#include "Test2.hpp"
#include <iostream>

void sort(int L[], int n)
{
    int j,k,flag,temp;
    flag = n - 1;
    while (flag > 0) {
        k = flag - 1;
        flag = 0;
        for (j=0; j<=k; j++) {
            if (L[j] > L[j+1]) {
                temp  = L[j];
                L[j] = L[j+1];
                L[j+1] = temp;
                flag = j;
            }
        }
    }
}

void test2() {
    int array[4] = {7,2,3,4};
    sort(array, 4);
    std::cout<<"The  sorted numbers:";
    for (int i = 0; i<4; i++) {
        std::cout<<array[i];
    }
}
